package top.infopub.job.bpa.service.impl;

import java.math.BigDecimal;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import top.infopub.generic.GenericDao;
import top.infopub.generic.GenericServiceImpl;
import top.infopub.job.bpa.dao.IncaeSureDao;
import top.infopub.model.bpa.IncaeSure;
import top.infopub.job.bpa.service.IncaeSureService;

@Service
public class IncaeSureServiceImpl extends GenericServiceImpl<IncaeSure, String> implements
		IncaeSureService {

	@Autowired
	private IncaeSureDao incaeSureDao;
	
	@Override
	public GenericDao<IncaeSure, String> getDao() {
		return incaeSureDao;
	}

    @Override
    public int count(String proCode) {
        return incaeSureDao.count(proCode);
    }

    @Override
    public BigDecimal selectProQaOfInnerSure(Map<String, Object> where) {
        BigDecimal rs = incaeSureDao.selectProQaOfInnerSure(where);
        if (rs == null) {
            return BigDecimal.ZERO;
        }
        return rs;
    }

    @Override
    public BigDecimal selectProQaOfInnerSureBefore(Map<String, Object> where) {
        BigDecimal rs = incaeSureDao.selectProQaOfInnerSureBefore(where);
        if (rs == null) {
            return BigDecimal.ZERO;
        }
        return rs;
    }

    @Override
    public BigDecimal selectMonthPreAmountOfSub(Map<String, Object> where) {
        return incaeSureDao.selectMonthPreAmountOfSub(where);
    }

    @Override
    public BigDecimal selectProQaOfInnerSureSum(Map<String, Object> where) {
        BigDecimal rs = incaeSureDao.selectProQaOfInnerSureSum(where);
        if (rs == null) {
            return BigDecimal.ZERO;
        }
        return rs;
    }

}